Returns a set of complete partially directed acyclic graphs (CPDAGs) given an
input DAG. CPDAGs are Markov equivalent to the input graph. See
dagitty::equivalentDAGs()
for details.
node_equivalent_dags()
returns a set of DAGs, while
node_equivalent_class()
tags reversable edges.
ggdag_equivalent_dags()
plots all equivalent DAGs, while
ggdag_equivalent_class()
plots all reversable edges as undirected.
node_equivalent_dags(.dag, n = 100, layout = "auto", ...)ggdag_equivalent_dags(
.tdy_dag,
...,
node_size = 16,
text_size = 3.88,
label_size = text_size,
text_col = "white",
label_col = "black",
node = TRUE,
stylized = FALSE,
text = TRUE,
use_labels = NULL
)
node_equivalent_class(.dag, layout = "auto")
ggdag_equivalent_class(
.tdy_dag,
expand_x = expansion(c(0.1, 0.1)),
expand_y = expansion(c(0.1, 0.1)),
breaks = ggplot2::waiver(),
...,
node_size = 16,
text_size = 3.88,
label_size = text_size,
text_col = "white",
label_col = text_col,
node = TRUE,
stylized = FALSE,
text = TRUE,
use_labels = NULL
)
a tidy_dagitty
with at least one DAG, including a dag
column to identify graph set for equivalent DAGs or a reversable
column for equivalent classes, or a ggplot
input graph, an object of class tidy_dagitty
or dagitty
maximal number of returned graphs.
a layout available in ggraph
. See ggraph::create_layout()
for details.
optional arguments passed to ggraph::create_layout()
an object of class tidy_dagitty
or dagitty
size of DAG node
size of DAG text
size of label text
color of DAG text
color of label text
logical. Should nodes be included in the DAG?
logical. Should DAG nodes be stylized? If so, use
geom_dag_nodes
and if not use geom_dag_point
logical. Should text be included in the DAG?
a string. Variable to use for geom_dag_repel_label()
.
Default is NULL
.
Vector of range expansion constants used to add some
padding around the data, to ensure that they are placed some distance away
from the axes. Use the convenience function ggplot2::expansion()
to
generate the values for the expand argument.
One of:
NULL for no breaks
waiver() for the default breaks computed by the transformation object
A numeric vector of positions
A function that takes the limits as input and returns breaks as output
g_ex <- dagify(y ~ x + z, x ~ z)
g_ex %>% node_equivalent_class()
g_ex %>% ggdag_equivalent_dags()
Run the code above in your browser using DataLab